package top.jingles.sayhiintime;

import android.Manifest;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
import android.widget.Toast;

public class ShareReceiverActivity
        extends Activity {

    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
//        setContentView(R.layout.activity_main);
    }

    private void handleImage(){
        Intent intent=getIntent();
        String action=intent.getAction();
        String type=intent.getType();
        Toast.makeText(getApplicationContext(), type + "====", Toast.LENGTH_SHORT).show();
        if(action.equals(Intent.ACTION_SEND)&&type.equals("image/*")){
            Uri uri=intent.getParcelableExtra(Intent.EXTRA_STREAM);
//            //接收多张图片
//            //ArrayList<Uri> uris=intent.getParcelableArrayListExtra(Intent.EXTRA_STREAM);
//            if(uri!=null ){
//                try {
//                    FileInputStream fileInputStream=new FileInputStream(uri.getPath());
//                    Bitmap bitmap= BitmapFactory.decodeStream(fileInputStream);
//                    imageView.setImageBitmap(bitmap);
//                } catch (FileNotFoundException e) {
//                    e.printStackTrace();
//                }
//            }
        }
    }

}